[2/3] Add direct action call path to dispatcher - #2992
Merged
George Ng (GeorgeNgMsft) merged 5 commits intoSep 19, 2026
Merged
Conversation
George Ng (GeorgeNgMsft)
added this pull request to stack #2994
September 11, 2026 07:20
Base automatically changed from
georgengmsft-structured-action-contracts
to
main
September 18, 2026 06:44
George Ng (GeorgeNgMsft)
force-pushed
the
georgengmsft-guarded-action-execution
branch
3 times, most recently
from
September 18, 2026 18:36
bd73a44 to
2e64a44
Compare
Dominic Nguyen (datduyng)
approved these changes
Sep 18, 2026
George Ng (GeorgeNgMsft)
marked this pull request as ready for review
September 18, 2026 23:42
Run typed actions through the existing dispatcher queue with live contract, scope and confirmation guards. Preserve true results, validate and resume interactions without replay, and bind trusted host reconnects to the same logical owner. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Materialize inherited process.emit before signal-exit registration can add an enumerable export during Jest ESM linking. Cover inherited and instrumented own emit properties, wrapper cleanup and real signal-exit callback behavior without host-process side effects. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Resolve actions by exact identity against current scope, schema, readiness, permissions, and policy without contract fingerprints. Revalidate parameters and confirmation policy at effect boundaries and preserve isolated structured choices. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
George Ng (GeorgeNgMsft)
force-pushed
the
georgengmsft-guarded-action-execution
branch
from
September 18, 2026 23:42
2e64a44 to
a6049a3
Compare
Keep in-flight operations authorized across trusted reconnect takeover, make continuation retries recover the current observable result without replay, and avoid marking entity preparation as a possible effect. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
George Ng (GeorgeNgMsft)
added a commit
that referenced
this pull request
Sep 19, 2026
This PR removes duplicated dispatcher cancellation code while keeping the public cancellation APIs separate. `cancelCommand` and structured `cancelAction` still provide different ownership checks and result shapes, but they now share one internal helper for removing queued requests, marking running requests cancelled, and aborting their controller. ## Changes - Add an internal `cancelQueuedRequest` helper for request-ID-based queue cancellation. - Reuse it from `Dispatcher.cancelCommand`. - Reuse it from structured operation cancellation after the structured terminal result has been published. - Preserve event-before-abort ordering, queued/running/not-found results, and idempotent running cancellation. - Leave `cancelCommandByClientId` and the agent-RPC `cancelAction(actionContextId)` path unchanged. ## Validation - Dispatcher cancellation and queue suites: 5 suites, 112 tests. - Dispatcher RPC: 19 tests. - Agent-server structured host: 7 tests. - Agent-server dependency build and formatting checks. - Lint, complexity, circular-dependency, and test-debt ratchets against PR #2992 head `a6049a3bf15966d09db5c0b5fc8e8b2deb0bf257`. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a safe way for clients to run a specific TypeAgent action using structured input. It uses the dispatcher’s existing queue and action engine, asks the user before making changes, pauses when the action needs more information, and returns the action’s real result. It also lets the same conversation reconnect to unfinished work without allowing another client to take control.
Where this fits
This is layer 2 of the structured-action stack:
#2991 has merged, so this draft now targets
main. Native stack #2994 still tracks[2991, 2992, 2993].What changed
executeAction,continueAction, andcancelActionto the public dispatcher API and dispatcher RPC.executeActionsengine. The implementation does not turn parameters back into command text or send them through natural-language interpretation.schemaNameandactionName. Search ranking is only used to help clients discover actions; it never decides which action is executed.cancelActionis separate from the existing internal agent-RPC cancellation message: it checks the conversation scope and returns a structured result.completed,failed,cancelled,requires_interaction,unavailable, orexecution_uncertain. Completed operations include the real action output, values, and entities.signal-exitcould change the exported shape ofprocesswhile tests were loading.API flow
First, the client joins a conversation and opts into structured actions:
The client searches for an action through the API added in #2991, chooses one exact contract, and sends concrete parameters:
If the action needs confirmation or another answer, it returns
requires_interaction. The client sends the answer back to the same operation:Cancellation uses the same
scopeIdandoperationId. If the client disconnects, it can rejoin the same conversation with the resume token instead of starting the action again.There is no contract fingerprint or
contract_staleresult. The dispatcher checks the current action definition and validates the current parameters each time it reaches an execution boundary. If the action was removed or disabled, it is unavailable. If its current input schema no longer accepts the parameters, execution fails before entering the handler.State limits
To keep memory use bounded, each dispatcher context keeps at most 100 live operations. Operations and interactions expire after 10 minutes, and the latest 100 finished results are retained for 10 minutes. The server keeps at most 100 structured-action conversation bindings, which expire after 30 minutes without use.
Validation